package lzyc.pointsManagement.common.response;

/**
 * 构造返回值实例
 * @author guozhiqi
 */
public class ResponseMessageUtility {
    /**
     * 创建默认的实例
     * @return
     */
    public static ResponseMessage create() {
        return new ResponseMessage();
    }

    /**
     * 创建返回值为成功的实例信息
     * @return
     */
    public static ResponseMessage createSuccess() {
        ResponseMessage ResponseMessage = create();
        ResponseMessage.setCode(ResponseCode.Success);
        ResponseMessage.setMsg("");
        return ResponseMessage;
    }

    /**
     * 创建返回值为成功的实例信息
     * @return
     */
    public static ResponseMessage createSuccess(String successMessage) {
        ResponseMessage ResponseMessage = create();
        ResponseMessage.setCode(ResponseCode.Success);
        ResponseMessage.setMsg(successMessage);
        return ResponseMessage;
    }


    public static ResponseMessage createError(String errorMessage) {
        ResponseMessage ResponseMessage = create();
        ResponseMessage.setMsg(errorMessage);
        ResponseMessage.setCode(ResponseCode.Error);
        return ResponseMessage;
    }
}
